{% extends "zinnia/base.html" %}
{% load i18n tagging_tags zinnia_tags disqus_tags %}

{% block meta-description %}{% trans "Latest entries for" %} {% if category %}{% trans "the category" %} {{ category }}{% if category.description %}: {{ category.description|striptags|safe }}{% endif %}{% endif %}{% if tag %}{% trans "the tag" %} {{ tag }}{% endif %}{% if author %}{% trans "the author" %} {{ author }}{% endif %}{% if page_obj %}{% ifnotequal page_obj.number 1 %} {% trans "page" %} {{ page_obj.number }}{% endifnotequal %}{% endif %}{% endblock %}

{% block link %}
  {{ block.super }}
  <link rel="alternate" type="application/rss+xml" title="{% trans "RSS Feed" %} {{ tag.name }}" href="{% url zinnia_tag_feed tag.name %}" />
{% endblock %}

{% block title %}{% trans "Latest entries" %} {% if category %}| {% trans "Category" %} {{ category }}{% endif %}{% if tag %}| {% trans "Tag" %} {{ tag }}{% endif %}{% if author %}| {% trans "Author" %} {{ author }}{% endif %}{% if page_obj %}{% ifnotequal page_obj.number 1 %} | {% trans "Page" %} {{ page_obj.number }}{% endifnotequal %}{% endif %}{% endblock %}

{% block content %}

<h1>{% trans "Tag" %} : {{ tag }}</h1>
<p>
<a href="{% url zinnia_tag_feed tag.name %}"><img src="{{MEDIA_URL}}img/07.png" /> RSS, Todas las entradas marcadas con: <strong>{{ tag.name }}</strong></a>
</p>

{% for object in object_list %}
<div id="entry-{{ object.pk }}" class="hentry{% if object.featured %} featured{% endif %} span-16 last">
  {% with object.html_content|truncatewords_html:100|safe as object_content %}
  {% include "zinnia/_entry_detail.html" %}
  {% endwith %}
</div>
{% if not forloop.last %}
<hr />
{% else %}
<div style="clearfix"></div>
{% endif %}

{% empty %}
  {% trans "No entries yet." %}
{% endfor %}

{% if is_paginated %}
  {% zinnia_pagination page_obj %}
{% endif %}
{% disqus_count %}
{% endblock %}

{% block admin_tools %}
  {% if category and perms.zinnia.change_category %}
  <li>
    <a href="{% url admin:zinnia_category_change category.pk %}" title="{% trans "Edit the category" %}">
      {% trans "Edit the category" %}
    </a>
  </li>
  {% endif %}
  {% if tag and perms.tagging.change_tag %}
  <li>
    <a href="{% url admin:tagging_tag_change tag.pk %}" title="{% trans "Edit the tag" %}">
      {% trans "Edit the tag" %}
    </a>
  </li>
  {% endif %}
  {% if author and perms.auth.change_user %}
  <li>
    <a href="{% url admin:auth_user_change author.pk %}" title="{% trans "Edit the author" %}">
      {% trans "Edit the author" %}
    </a>
  </li>
  {% endif %}
{% endblock %}

